<template>
	<view>
		<view class="list_box">
			<view class="list">
				<text>门店名称</text>
				<input class="input" type="text" v-model="stores.store_name" placeholder-style="text-align:right;color:#999999;" />
				
			</view>
			<view class="list">
				<text>地&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;址</text>
				
				<input class="input" type="text" v-model="stores.address" placeholder-style="text-align:right;color:#999999;" />
				
			</view>
			<view class="list">
				<text>店&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;长</text>
				
				<input class="input" type="text" v-model="stores.store_manage" placeholder-style="text-align:right;color:#999999;" />
				
			</view>
			<view class="list">
				<text>联系电话</text>
				
				<input class="input" type="text" v-model="stores.tel_phone" placeholder-style="text-align:right;color:#999999;" />
				
			</view>
			<view class="list">
				<text>营业时间</text>
				
				<input class="input" type="text" v-model="stores.work_time" placeholder-style="text-align:right;color:#999999;" />
				
			</view>
		</view>
		<view class="submit">
			<view  @click="confirm">提交</view>
		</view>
	</view>
</template>

<script>
	import request from '@/common/lib/request.js'
	export default {
		data() {
			return {
				stores:'',
			}
		},
		onLoad:function(option){
			this.stores=option
		},
		methods: {
			confirm(){
				uni.request({
					url: request.common.baseUrl+'/api/agent/storeSet',
					data: {
						token:uni.getStorageSync('keyToken'),
						id:this.stores.id,
						store_name:this.stores.store_name,
						address:this.stores.address,
						tel_phone:this.stores.tel_phone,
						work_time:this.stores.work_time,
						store_manage:this.stores.store_manage
					},
					header: {
						'Content-Type':'application/json;charset=UTF-8',
						'Content-Type':'application/x-www-form-urlencoded'
					},
					success: (res) => {
						if(res.data.code==200){
							uni.showToast({
								title: res.data.msg,
								duration: 2000,
								icon: 'none'
							})
							uni.navigateBack({
								delta:1
							})
						}else{
							uni.showToast({
								title: res.data.msg,
								duration: 2000,
								icon: 'none'
							})
						}
					}
				})
			}
		}
	}
</script>

<style>
page{
	background-color: #ffffff;
}
.list_box{
	width:700upx;
	margin:0 25upx;
}
.list{
	width:700upx;
	height:100upx;
	line-height:100upx;
	border-bottom:1upx solid #f6f6f6;
	text-indent:20upx;
}
.input{
	display:inline-flex;
}
.list view:nth-child(1){
	float:left;
	height:100upx;
	line-height:100upx;
}
.list view:nth-child(2){
	float:right;
	height:100upx;
	line-height:100upx;
}
.list view:nth-child(2) text:nth-child(1){
	color:#999999;
	font-size:20upx;
}
.list view:nth-child(2) text:nth-child(2){
	margin-left:20upx;
}
.submit{
	margin-top:50upx;
	text-align:center;
}
.submit view{
	background-color:#ff6101;
	color:#FFFFFF;
	font-size:28upx;
	width:650upx;
	height:60upx;
	line-height:60upx;
	margin:auto;
	border-radius:30upx;
}
</style>
